package com.example.peibei.ui.adapter;

import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.CircleCrop;
import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.dingtao.common.bean.OrderComment;
import com.dingtao.common.bean.SystemMessage;
import com.example.peibei.R;

import java.util.List;

public class OrderCommentAdapter extends BaseQuickAdapter<OrderComment.ListDTO, BaseViewHolder> {
    public OrderCommentAdapter(@Nullable List<OrderComment.ListDTO> data) {
        super(R.layout.comment_list_item_layout, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, OrderComment.ListDTO item) {
        ImageView head = helper.getView(R.id.iv_head);
        Glide.with(getContext()).load(item.getImgUrl()).apply(RequestOptions.bitmapTransform(new CircleCrop())).into(head);
        helper.setText(R.id.commentMember,item.getNickName()).setText(R.id.message,item.getCommentContent());
        LinearLayout zan_ly = helper.getView(R.id.zan_ly);
        TextView addTime = helper.getView(R.id.addTime);
        zan_ly.setVisibility(View.GONE);
        addTime.setVisibility(View.GONE);

        LinearLayout rply_ly = helper.getView(R.id.rply_ly);
        rply_ly.setVisibility(View.GONE);
    }
}
